package com.matrix.java.chap_06;

import java.util.Scanner;

/*
    反向显示一个整数
 */
public class Ex6_04 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("整数: ");
        long num = input.nextLong();
        input.close();
        reverse(num);
    }

    private static void reverse(long num) {
        long reverse = 0;
        do {
            reverse = reverse * 10 + num % 10;
            num /= 10;
        } while (num != 0);
        System.out.println(reverse);
    }
}
